.class Lcom/trademob/tracking/TMUniversalTrackingInternal;
.super Ljava/lang/Object;
.source "TMUniversalTrackingInternal.java"


# instance fields
.field private final myErrorTracker:Lcom/trademob/tracking/TMErrorTracker;

.field private final myRequestProcessor:Lcom/trademob/tracking/TMRequestProcessor;

.field private final myRequestStringBuilder:Lcom/trademob/tracking/TMRequestStringBuilder;

.field private final myUtility:Lcom/trademob/tracking/TMUtility;


# direct methods
.method public constructor <init>(Landroid/content/Context;)V
    .locals 3
    .parameter "aContext"

    .prologue
    .line 28
    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    .line 30
    invoke-virtual {p1}, Landroid/content/Context;->getApplicationContext()Landroid/content/Context;

    move-result-object v0

    .line 31
    .local v0, bufferedContext:Landroid/content/Context;
    new-instance v1, Lcom/trademob/tracking/TMRequestStringBuilder;

    invoke-direct {v1, v0}, Lcom/trademob/tracking/TMRequestStringBuilder;-><init>(Landroid/content/Context;)V

    iput-object v1, p0, Lcom/trademob/tracking/TMUniversalTrackingInternal;->myRequestStringBuilder:Lcom/trademob/tracking/TMRequestStringBuilder;

    .line 32
    new-instance v1, Lcom/trademob/tracking/TMUtility;

    invoke-direct {v1, v0}, Lcom/trademob/tracking/TMUtility;-><init>(Landroid/content/Context;)V

    iput-object v1, p0, Lcom/trademob/tracking/TMUniversalTrackingInternal;->myUtility:Lcom/trademob/tracking/TMUtility;

    .line 33
    new-instance v1, Lcom/trademob/tracking/TMRequestProcessor;

    invoke-direct {v1, v0}, Lcom/trademob/tracking/TMRequestProcessor;-><init>(Landroid/content/Context;)V

    iput-object v1, p0, Lcom/trademob/tracking/TMUniversalTrackingInternal;->myRequestProcessor:Lcom/trademob/tracking/TMRequestProcessor;

    .line 34
    new-instance v1, Lcom/trademob/tracking/TMErrorTracker;

    iget-object v2, p0, Lcom/trademob/tracking/TMUniversalTrackingInternal;->myUtility:Lcom/trademob/tracking/TMUtility;

    invoke-direct {v1, v2}, Lcom/trademob/tracking/TMErrorTracker;-><init>(Lcom/trademob/tracking/TMUtility;)V

    iput-object v1, p0, Lcom/trademob/tracking/TMUniversalTrackingInternal;->myErrorTracker:Lcom/trademob/tracking/TMErrorTracker;

    .line 36
    iget-object v1, p0, Lcom/trademob/tracking/TMUniversalTrackingInternal;->myUtility:Lcom/trademob/tracking/TMUtility;

    invoke-virtual {v1}, Lcom/trademob/tracking/TMUtility;->permissionLogger()V

    .line 37
    return-void
.end method


# virtual methods
.method public trackActionAlways(Ljava/lang/String;ILjava/lang/String;)V
    .locals 5
    .parameter "aAction"
    .parameter "aValue"
    .parameter "aSubId"

    .prologue
    .line 69
    :try_start_0
    iget-object v1, p0, Lcom/trademob/tracking/TMUniversalTrackingInternal;->myRequestProcessor:Lcom/trademob/tracking/TMRequestProcessor;

    iget-object v2, p0, Lcom/trademob/tracking/TMUniversalTrackingInternal;->myRequestStringBuilder:Lcom/trademob/tracking/TMRequestStringBuilder;

    invoke-virtual {v2, p1, p2, p3}, Lcom/trademob/tracking/TMRequestStringBuilder;->generateRequestStringForAction(Ljava/lang/String;ILjava/lang/String;)Ljava/lang/String;

    move-result-object v2

    invoke-virtual {v1, v2}, Lcom/trademob/tracking/TMRequestProcessor;->loadUrl(Ljava/lang/String;)V
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0

    .line 77
    :goto_0
    return-void

    .line 71
    :catch_0
    move-exception v0

    .line 74
    .local v0, e:Ljava/lang/Exception;
    iget-object v1, p0, Lcom/trademob/tracking/TMUniversalTrackingInternal;->myErrorTracker:Lcom/trademob/tracking/TMErrorTracker;

    const-string v2, "TMUniversalTracking.trackActionAlways"

    new-instance v3, Ljava/lang/StringBuilder;

    const-string v4, "aAction: "

    invoke-direct {v3, v4}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    invoke-virtual {v3, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v3

    const-string v4, " aValue: "

    invoke-virtual {v3, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v3

    invoke-virtual {v3, p2}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;

    move-result-object v3

    const-string v4, " aSubId: "

    invoke-virtual {v3, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v3

    invoke-virtual {v3, p3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v3

    invoke-virtual {v3}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v3

    invoke-virtual {v1, v0, v2, v3}, Lcom/trademob/tracking/TMErrorTracker;->addStandardData(Ljava/lang/Exception;Ljava/lang/String;Ljava/lang/String;)V

    .line 75
    iget-object v1, p0, Lcom/trademob/tracking/TMUniversalTrackingInternal;->myErrorTracker:Lcom/trademob/tracking/TMErrorTracker;

    invoke-virtual {v1}, Lcom/trademob/tracking/TMErrorTracker;->sendErrorData()V

    goto :goto_0
.end method

.method public trackActionOnce(Ljava/lang/String;ILjava/lang/String;)V
    .locals 5
    .parameter "aAction"
    .parameter "aValue"
    .parameter "aSubId"

    .prologue
    .line 88
    :try_start_0
    iget-object v1, p0, Lcom/trademob/tracking/TMUniversalTrackingInternal;->myUtility:Lcom/trademob/tracking/TMUtility;

    new-instance v2, Ljava/lang/StringBuilder;

    const-string v3, "TMCustomAction"

    invoke-direct {v2, v3}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    invoke-virtual {v2, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v2

    invoke-virtual {v2}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v2

    invoke-virtual {v1, v2}, Lcom/trademob/tracking/TMUtility;->isStored(Ljava/lang/String;)Z

    move-result v1

    if-nez v1, :cond_0

    .line 90
    iget-object v1, p0, Lcom/trademob/tracking/TMUniversalTrackingInternal;->myUtility:Lcom/trademob/tracking/TMUtility;

    new-instance v2, Ljava/lang/StringBuilder;

    const-string v3, "TMCustomAction"

    invoke-direct {v2, v3}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    invoke-virtual {v2, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v2

    invoke-virtual {v2}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v2

    invoke-virtual {v1, v2, p1}, Lcom/trademob/tracking/TMUtility;->store(Ljava/lang/String;Ljava/lang/String;)V

    .line 91
    iget-object v1, p0, Lcom/trademob/tracking/TMUniversalTrackingInternal;->myRequestProcessor:Lcom/trademob/tracking/TMRequestProcessor;

    iget-object v2, p0, Lcom/trademob/tracking/TMUniversalTrackingInternal;->myRequestStringBuilder:Lcom/trademob/tracking/TMRequestStringBuilder;

    invoke-virtual {v2, p1, p2, p3}, Lcom/trademob/tracking/TMRequestStringBuilder;->generateRequestStringForAction(Ljava/lang/String;ILjava/lang/String;)Ljava/lang/String;

    move-result-object v2

    invoke-virtual {v1, v2}, Lcom/trademob/tracking/TMRequestProcessor;->loadUrl(Ljava/lang/String;)V
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0

    .line 100
    :cond_0
    :goto_0
    return-void

    .line 94
    :catch_0
    move-exception v0

    .line 97
    .local v0, e:Ljava/lang/Exception;
    iget-object v1, p0, Lcom/trademob/tracking/TMUniversalTrackingInternal;->myErrorTracker:Lcom/trademob/tracking/TMErrorTracker;

    const-string v2, "TMUniversalTracking.trackActionOnce"

    new-instance v3, Ljava/lang/StringBuilder;

    const-string v4, "aAction: "

    invoke-direct {v3, v4}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    invoke-virtual {v3, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v3

    const-string v4, " aValue: "

    invoke-virtual {v3, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v3

    invoke-virtual {v3, p2}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;

    move-result-object v3

    const-string v4, " aSubId: "

    invoke-virtual {v3, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v3

    invoke-virtual {v3, p3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v3

    invoke-virtual {v3}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v3

    invoke-virtual {v1, v0, v2, v3}, Lcom/trademob/tracking/TMErrorTracker;->addStandardData(Ljava/lang/Exception;Ljava/lang/String;Ljava/lang/String;)V

    .line 98
    iget-object v1, p0, Lcom/trademob/tracking/TMUniversalTrackingInternal;->myErrorTracker:Lcom/trademob/tracking/TMErrorTracker;

    invoke-virtual {v1}, Lcom/trademob/tracking/TMErrorTracker;->sendErrorData()V

    goto :goto_0
.end method

.method public trackAppload()V
    .locals 4

    .prologue
    .line 49
    :try_start_0
    iget-object v1, p0, Lcom/trademob/tracking/TMUniversalTrackingInternal;->myRequestProcessor:Lcom/trademob/tracking/TMRequestProcessor;

    iget-object v2, p0, Lcom/trademob/tracking/TMUniversalTrackingInternal;->myRequestStringBuilder:Lcom/trademob/tracking/TMRequestStringBuilder;

    invoke-virtual {v2}, Lcom/trademob/tracking/TMRequestStringBuilder;->generateRequestStringForAppload()Ljava/lang/String;

    move-result-object v2

    invoke-virtual {v1, v2}, Lcom/trademob/tracking/TMRequestProcessor;->loadUrl(Ljava/lang/String;)V
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0

    .line 57
    :goto_0
    return-void

    .line 51
    :catch_0
    move-exception v0

    .line 54
    .local v0, e:Ljava/lang/Exception;
    iget-object v1, p0, Lcom/trademob/tracking/TMUniversalTrackingInternal;->myErrorTracker:Lcom/trademob/tracking/TMErrorTracker;

    const-string v2, "TMUniversalTracking.trackAppload"

    const-string v3, "no-params"

    invoke-virtual {v1, v0, v2, v3}, Lcom/trademob/tracking/TMErrorTracker;->addStandardData(Ljava/lang/Exception;Ljava/lang/String;Ljava/lang/String;)V

    .line 55
    iget-object v1, p0, Lcom/trademob/tracking/TMUniversalTrackingInternal;->myErrorTracker:Lcom/trademob/tracking/TMErrorTracker;

    invoke-virtual {v1}, Lcom/trademob/tracking/TMErrorTracker;->sendErrorData()V

    goto :goto_0
.end method

.method public trackReferrerStart(Ljava/lang/String;)V
    .locals 3
    .parameter "aQuery"

    .prologue
    .line 112
    :try_start_0
    iget-object v1, p0, Lcom/trademob/tracking/TMUniversalTrackingInternal;->myRequestProcessor:Lcom/trademob/tracking/TMRequestProcessor;

    iget-object v2, p0, Lcom/trademob/tracking/TMUniversalTrackingInternal;->myRequestStringBuilder:Lcom/trademob/tracking/TMRequestStringBuilder;

    invoke-virtual {v2, p1}, Lcom/trademob/tracking/TMRequestStringBuilder;->generateRequestStringForReferrer(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v2

    invoke-virtual {v1, v2}, Lcom/trademob/tracking/TMRequestProcessor;->loadUrl(Ljava/lang/String;)V
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0

    .line 120
    :goto_0
    return-void

    .line 114
    :catch_0
    move-exception v0

    .line 117
    .local v0, e:Ljava/lang/Exception;
    iget-object v1, p0, Lcom/trademob/tracking/TMUniversalTrackingInternal;->myErrorTracker:Lcom/trademob/tracking/TMErrorTracker;

    const-string v2, "TMUniversalTracking.trackReferrerStart"

    invoke-virtual {v1, v0, v2, p1}, Lcom/trademob/tracking/TMErrorTracker;->addStandardData(Ljava/lang/Exception;Ljava/lang/String;Ljava/lang/String;)V

    .line 118
    iget-object v1, p0, Lcom/trademob/tracking/TMUniversalTrackingInternal;->myErrorTracker:Lcom/trademob/tracking/TMErrorTracker;

    invoke-virtual {v1}, Lcom/trademob/tracking/TMErrorTracker;->sendErrorData()V

    goto :goto_0
.end method
